<!--
@author     Yi Bo <etng2004@gmail.com>
@version    $Id: contacthistory_detaillist.php 65 2007-09-10 07:28:34Z etng2004 $
@copyrithg  2006-2007 ETE.CN
@license    PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
-->
<?php
$this->declareVars();
echo $this->render('header.php');
require_once(dirname(__FILE__) . '/_meta_contacthistory.php');
require_once(dirname(__FILE__) . '/_meta_client.php');
require_once(dirname(__FILE__) . '/_meta_staff.php');
require_once(dirname(__FILE__) . '/_meta_contact.php');
$contact_histories = $this->contact_histories;

?>
<div id="Whatever">
	<ul class="CategoryListTableLevel1">
	<li><a href="<?php echo $this->base_url; ?>/detaillist/date_region/today">今天</a><i></i></li>
	<li><a href="<?php echo $this->base_url; ?>/detaillist/date_region/yestoday">昨天</a><i></i></li>
	<li><a href="<?php echo $this->base_url; ?>/detaillist/date_region/week">本周</a><i></i></li>
	<li><a href="<?php echo $this->base_url; ?>/detaillist/date_region/month">本月</a><i></i></li>
	<li><a href="<?php echo $this->base_url; ?>/detaillist/">所有</a><i></i></li>
	</ul>
	<div class="HackBox"></div>
</div>

        <table cellspacing="0" cellpadding="0" class="tblborder" width="100%">
          <tr class="tblhead">
            <td><?php echo $meta['contact_history']['fields']['id'];?> </td>
            <td><?php echo $meta['client']['fields']['company'];?> </td>
            <td><?php echo $meta['client']['fields']['trade_type_id'];?> </td>
            <td><?php echo $meta['client']['fields']['alexa'];?> </td>
            <td>客户联系人</td>
            <td>工作人员</td>
            <td><?php echo $meta['contact_history']['fields']['contact_by'];?> </td>
            <td><?php echo $meta['contact_history']['fields']['conclusion'];?> </td>
            <td><?php echo $meta['contact_history']['fields']['contact_at'];?> </td>
            <td> 操作 </td>
          </tr>
          <?php
        if(!$contact_histories):
    ?>
          <tr class="tblbody">
            <td colspan="20"><div class="Tips"> 暂时没有联系记录</div></td>
          </tr>
          <?php
        else:
        foreach ($contact_histories as $contact_history):
    ?>
          <tr class="tblbody">
            <td><?php echo $contact_history['id']; ?></td>
            <td><a href="<?php echo $contact_history['client_website']; ?>" target="_blank"><?php echo $contact_history['client_company']; ?></a> </td>
            <td><?php echo $this->trade_types[$contact_history['trade_type_id']] ?></td>
              <td><?php echo $contact_history['client_alexa']; ?></td>
              <td><?php echo $contact_history['contact_name']; ?></td>
              <td><?php echo $contact_history['staff_name']; ?>(<?php echo $contact_history['staff_id']; ?>)</td>
            <td><?php echo $LANG['CONTACT_BY'][$contact_history['contact_by']]; ?></td>
            <td><?php echo $contact_history['conclusion']; ?></td>
            <td><?php echo $this->dateFormat($contact_history['contact_at']); ?></td>
            <td><a href="<?php echo $this->module_url;?>/client/view/id/<?php echo $contact_history['client_id']; ?>">查看客户</a></td>
          </tr>
          <?php
        endforeach;
    ?>
          <tr class="tblfoot">
            <td colspan="20" align="right"><?php
          echo $this->pagination($this->pager['total'], $this->pager['curpage'], $this->pager['perpage'], $this->pager['url'] );
?>
            </td>
          </tr>
          <?php
        endif;
    ?>
        </table>
<?php
echo $this->render('footer.php');
?>